package D1;

import java.util.StringJoiner;

public class Java08 {
    public static void main(String[] args) {
        //StringJoiner类，拼接神奇，效率高，代码简介
        StringJoiner s = new StringJoiner(",");
        s.add("java1");
        s.add("java2");
        s.add("java3");
        s.add("ajav4");
        System.out.println(s);
        //参数：1、间隔符，2、开头，3、结尾
        StringJoiner s1 = new StringJoiner(",","[","]");
        s1.add("java1");
        s1.add("java2");
        s1.add("java3");
        System.out.println(s1);
    }
}
